<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html lang="zh-cn">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no, email=no" />
<title>登录</title>
<link rel="stylesheet" href="<%=path %>/admin/css/pintuer.css">
<link rel="stylesheet" href="<%=path %>/admin/css/admin.css">
<script type="text/javascript"> var paths = '<%=path%>'; </script>
<script src="<%=path %>/admin/js/jquery.js"></script>
<script src="<%=path %>/admin/js/pintuer.js"></script>
<script src="<%=path %>/admin/js/pic.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/lrz.bundle.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/lrz.all.bundle.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/1.chunk.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/2.chunk.js"></script>
<script type="text/javascript" src="<%=path %>/admin/js/admin.js"></script>
<style>
    .form-center {
        width: 300px;
        margin: 0 auto;
    }
    .panel-border {
        border-bottom: 0;
    }
</style>
</head>
<body>
	<div class="panel admin-panel panel-border">
		<div class="body-content">
			<form id="planForm" method="post" class="form-x form-center" action="<%=path %>/bUserInfo/updateGrade">
			<c:forEach items="${args}" var="item" varStatus="vs">  
			         <input type="hidden" value="${item}" name="openid[]" class="openid"/>
			</c:forEach>
				<div class="form-group">
				 <select id="roleKey" name="roleKey" class="input"  style="width:300px; line-height:17px;display:inline-block">
			          <option value="">经销商等级</option>
			          <option value="1">青铜</option>
			          <option value="2">白银</option>
			          <option value="3">黄金</option>
			          <option value="4">铂金</option>
			          <option value="5">钻石</option>
		        </select>
				</div>
				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" type="button"
							onclick="javascript:sub();">提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</body>
<script type="text/javascript" src="<%=path%>/admin/js/layer/layer.js" ></script>
<script type="text/javascript">
	$(function(){
	    var subTag = '${subTag}';
	    if(subTag==1){
	        layer.msg('操作成功！');
	    }else if(subTag== 2){
	        layer.msg('系统忙！');
	    }
	});

	var flag=true;
	function sub(){
		if(true){
			falg=false;
		if($("#roleKey option:selected").val()==""){
			flag=true;
            layer.msg("请选择经销商等级");
        }else{
             var params = new Object();
             var arrayObj = new Array();
             params.roleKey=$("#roleKey option:selected").val();
             $(".openid").each(function(){
                 arrayObj.push($(this).val());
             })
             params.openid=arrayObj;
               $.ajax({ 
                    type:"post",
                    url:"<%=path %>/bUserInfo/updateGrade",
                    data:params,
                    dataType: "json",  
                    cache: false,  
                    error: function(){
                    	flag=true;
                        alert("系统忙...");
                    },
                    success: function(data){
                    	flag=true;
                        var json=eval(data);
                        layer.msg(json.msg);
                    }
               })
         }
		}
		
	};
	
</script>
</html>